/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package DatabasePack;

import java.sql.ResultSet;

/**
 *
 * @author abdosalah
 */
public class company {

    public static int Update_Company_money(String company_name, int money) {
        try {
            ResultSet company;
            company = sqlstatments.Select_with_string_condition("COMPANY", "NAME", company_name);     
            int update_company_money = company.getInt("BALABNCE");
            update_company_money = update_company_money + money;
            sqlstatments.update_one_Integer_col_with_string_condition("company", "BALABNCE", update_company_money, "Name", company_name);
            return company.getInt("ID");
        } catch (Exception e) {
            System.out.println("company class");
            e.printStackTrace();
        }
        return -1;
    }
}
